{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Python \t\t3.6\n"
     ]
    }
   ],
   "source": [
    "import sys; print('Python \\t\\t{0[0]}.{0[1]}'.format(sys.version_info))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "%matplotlib inline \n",
    "\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Extracting ./train-images-idx3-ubyte.gz\n",
      "Extracting ./train-labels-idx1-ubyte.gz\n",
      "Extracting ./t10k-images-idx3-ubyte.gz\n",
      "Extracting ./t10k-labels-idx1-ubyte.gz\n"
     ]
    }
   ],
   "source": [
    "from tensorflow.examples.tutorials.mnist import input_data\n",
    "mnist = input_data.read_data_sets(\"./\", one_hot=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(55000, 784)"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mnist.train.images.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA2oAAABpCAYAAABLV9A4AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xec1MX9x/HXBIMKRiwUTywgNrALYkM0llA0lqgxihEC\nBh8xGCXBFjVRrImgxC62GBV/sUcRu2IhagAVC7agh4iIolGjRhT9/v7gPrOz7N6xtzu7+9279/Px\n8OEwe7c7+75t3535fsYlSYKIiIiIiIikx/eqPQARERERERHJpgM1ERERERGRlNGBmoiIiIiISMro\nQE1ERERERCRldKAmIiIiIiKSMjpQExERERERSRkdqImIiIiIiKRMSQdqzrmBzrnXnXP/ds6dFGtQ\nrZkyjU+ZlodyjU+ZxqdM41Om8SnT+JRpfMq08lyxG14759oAbwB7Ae8C04FDkySZHW94rYsyjU+Z\nlodyjU+ZxqdM41Om8SnT+JRpfMq0OlYo4Xf7Av9OkuQtAOfc/wH7AY3+wTp27Jh069athJtsuWbO\nnLkI2BdlGo0yjW/mzJmLkiTpRDOf/8q0cco0PmUaX7GZgnJtTH19PYsWLXIo06j03h+fMo0veE1t\nUikHal2BecG/3wW2X/aHnHMjgZEA6623HjNmzCjhJlsu59xclGlUyjS+hkyhgFyVaWGUaXzKNL7m\nZNrw88p1Ofr06WNNZRqR3vvjU6bxBa+pTSp7MZEkSSYmSdInSZI+nTot98BRCqBM41Om8SnT+JRp\nfMq0PJRrfMo0PmUanzKNq5QDtfnAusG/12nok+Ip0/iUaXko1/iUaXzKND5lGp8yjU+ZxqdMq6CU\nA7XpwEbOue7OubbAz4C74wyr1VKm8SnT8lCu8SnT+JRpfMo0PmUanzKNT5lWQdHnqCVJssQ5Nwp4\nAGgDXJskySvRRhbRGWec4dvXX389ALfccovvC9aJV1UtZVorlGl5KNf4lGl8yjQ+ZRqfMo1Pmcan\nTKujlGIiJEkyBZgSaSyCMi0HZVoeyjU+ZRqfMo1PmcanTONTpvEp08orezERERERERERaZ6SZtTS\nburUqQBceeWVvq99+/YAWeVC07L0UUREREREBDSjJiIiIiIikjotbkbtv//9r28ffPDBABxxxBG+\n709/+hMAzrnKDkxEas5dd90FwOjRo33fpEmTANhxxx2rMiYRadp3330HwI033uj7Xnklt+bBs88+\n69vbb7903962bdv6Pnvet2nTxvd16NAh7mBbmbvvXlok8NJLL/V9VtxN2Uo5rLfeejl977zzThVG\nUhzNqImIiIiIiKSMDtRERERERERSpsUtfbz88st9e6WVVgJgzJgxvm+FFVrcXa66N954A4ARI0b4\nvrffftu3bfnJxx9/7PvuvfdeAM477zzf16lTp7KOU6S57rjjDgDmzp3r++xxPnv27KqMSaS1C09x\nWLhwIQB/+ctffN9hhx0GwNChQ5u8nh122MG3J06cCEBdXZ3vmzZtGgCzZs3yfccddxwAxx9/vO+z\nzxqS3zPPPOPbw4YNA2CfffbxfSuuuGKlhyStyLx58wBYd911qzyS4mhGTUREREREJGVa3PSSFQsB\nOOqoo4Dsb8gkjldffdW3Bw0aBGSfnJkkiW8PGDAAgI022sj32WzEzJkzfd/DDz8MQMeOHcsw4vSy\nb4TXXHNN32czv4sXL/Z9H3zwQc7vPv7447793HPPNXobV111lW+vvfbaOZf/+c9/BmC//fYrdNit\nwvTp06s9hKr47LPPAPjDH/7g+8IZi6b8+Mc/9u2LL74YgPXXXz/i6KQ1+fzzz33b3jfOPPNM3zd5\n8uSc37nkkksA6Nu3r++zWba33nrL92222Wa+bbNrW265pe974oknADj88MN9n82yLViwwPddcMEF\ngGbWlnXfffcBcMUVV/i+//znPwCstdZavq+15vbRRx8Bmc8+AOPGjQOyt5AK/fa3vwVg/PjxZR5d\nbbMCNZB5btvztDnComFWoND+BpWiGTUREREREZGU0YGaiIiIiIhIyrSYpY92cvHXX3/t+3r27Fmt\n4bRYJ554IgCPPvqo77Mlj127dvV94TK+F198EYAjjzzS99mJ23YZwI9+9CMgs7QEYOWVV4429mqx\n+wrZSxzMY489BmRPsdtSEFsaEf5cKFxi2tTegOHPvfnmmzmX2xKftC99vPXWWwG4+eabfd9ZZ50F\nQK9evSoyBltC1dI89dRTvj1y5EgAXnvtNd+X7/G10047AfD666/7vnApmhURCJebrbLKKpFGXPss\nK3tcQ/Z7mAnzXXXVVYHsJf3nnHMOAN27dy/LOKspLNpje53lEz4+DzjgACB7r65wqV2h+vfvD8DA\ngQN932233QbAAw884Pt+97vfAdCjR49m30ZL87///c+3r776aiCzdxpk9qnbdtttKzuwlLCln5D5\nzPP888/n/Fz4eA7fv63A1amnnur7Vl999ejjrFVWOOSQQw7xfbb0sTl7n9r1hIVwnn766RhDbDbN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iIpowM1ERER\nERGRlNGBmoiIiIiISMr8PzT+1wrcrWcKAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x10f31ea58>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.figure(figsize=(15,5))\n",
    "for i in list(range(10)):\n",
    "    plt.subplot(1, 10, i+1)\n",
    "    pixels = mnist.test.images[i+100]\n",
    "    pixels = pixels.reshape((28, 28))\n",
    "    plt.imshow(pixels, cmap='gray_r')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def test_render(pixels, result, truth):\n",
    "    #pixels, result and truth are np vectors\n",
    "    plt.figure(figsize=(10,5))\n",
    "    plt.subplot(1, 2, 1)\n",
    "    pixels = pixels.reshape((28, 28))\n",
    "    plt.imshow(pixels, cmap='gray_r')\n",
    "\n",
    "    plt.subplot(1, 2, 2)\n",
    "    \n",
    "    #index, witdh\n",
    "    ind = np.arange(len(result))\n",
    "    width = 0.49\n",
    "\n",
    "    plt.barh(ind,result, width, color='orange', edgecolor='k', hatch=\"/\")\n",
    "    plt.barh(ind+width,truth,width, color='g', edgecolor='k')\n",
    "    plt.yticks(ind+width, range(10))\n",
    "    plt.margins(y=0)\n",
    "\n",
    "    plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAlMAAAEyCAYAAADeAVWKAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHUpJREFUeJzt3X2QXXWd5/HPJwkxhM4QIG3sTQJhGcYiw6xBWmSWh00I\nxpC1QHcHAXFARJo/YHhQdmWYrQJnyy2ZGQkTSjK0yoIDIkQBUy6PxRABa8za0QAhkZVleEjIQ7OM\nmsaSmOS7f9wbaNrunNN97r2/c/q+X1Vdffve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VqZ6m9pymJWSTqv/q6+4yX9quhJitnNBwB1EbHL9qWSHtY7V2d4zvZf\nS+qLiFWqXY7nH22/oNpBrmenS/xuOfP/raQOSSvrx82/EhGnJws9RM6fobRy5n9Y0mLbGyTtlvRf\nIqIUWzdz5v+CpK/bvlK1g9E/U6J/ULzrihr147qulbSfJEXEP6h2nNdSSS9I+o2kCwo/Z4l+fgAA\ngMphNx8AAEABlCkAAIACKFMAAAAFUKYAAAAKoEwBAAAUQJkCAAAogDIFAABQwP8H4LV183sP7oEA\nAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1187c3b38>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import random\n",
    "i = 100 #it's a \"six\" \n",
    "\n",
    "\n",
    "pixels = mnist.test.images[i]\n",
    "truth  = mnist.test.labels[i]\n",
    "result = [0.3, 0.1, 0., 0., 0., 0., 0.9, 0., 0., 0. ]\n",
    "\n",
    "test_render(pixels, result, truth)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
